/**
 * 用户详情对话框
 */
var UserInfoDlg = {
    data: {
        deptId: "",
        deptName: ""
    }
};

layui.use(['layer', 'form', 'admin', 'laydate', 'ax'], function () {
    var $ = layui.jquery;
    var $ax = layui.ax;
    var form = layui.form;
    var admin = layui.admin;
    var layer = layui.layer;

    // 让当前iframe弹层高度适应
    admin.iframeAuto();

    //获取用户信息
    var ajax = new $ax(Feng.ctxPath + "/group/detail?id=" + Feng.getUrlParam("id"));
    var result = ajax.start();
    result.data.sendGroupId=result.data.tgGroupId;
    form.val('bindRelationshipForm', result.data);

    // 表单提交事件
    form.on('submit(btnSubmit)', function (data) {
        var ajax = new $ax(Feng.ctxPath + "/group/bindRelationship", function (data) {
            Feng.success("操作成功！");
            //传给上个页面，刷新table用
            admin.putTempData('formOk', true);
            //关掉对话框
            admin.closeThisDialog();
        }, function (rdata) {
            Feng.error("操作失败！" + rdata.responseJSON.message)
        });
        ajax.set(data.field);
        ajax.start();
    });
});